package com.wy.user.controller;

import com.wy.user.model.User;
import com.wy.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * @描述
 * @创建人 wangyue
 * @创建时间2019/9/1710:47
 */

@Controller
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("list")
    public ModelAndView list(Model model){
        List<User> userList = userService.list();
        model.addAttribute("userList",userList);
        return new ModelAndView("user/list");
    }
}
